package com.wonders.bigdata.easyExcel;

import com.alibaba.excel.EasyExcel;

import java.util.ArrayList;
import java.util.List;

/**
 * Description: <br>
 *
 * @author: XB
 * @date: 2021/11/12 16:39
 */
public class DataToExcelDemo {
    public static void main(String[] args) {
        try {
            String fileName = "/file/demo.xlsx";
            String data = "吴江,赵晓菁,麻静,张伟明,鞠强,姜立新,沈洪兴,蒋捍东,刘开江,周滟,刘强," +
                    "冯军峰,骆艳丽,胡耀敏,白永瑞,房静远,张岚,曹晖,李吉平,陆尔奕,方宁远,卢燕鸣," +
                    "侯健,孙贇,翟博,李晓波,徐仁应,管阳太,刘颖斌,朱长清,郭胤仕,柳林,卜军,林厚文," +
                    "王卓颖,董宇启,刘培峰,王理伟,薛松,皋源,王友,陆宁,夏强,陆劲松,叶霜,顾乐怡," +
                    "赵爱民,刘祖德,张晓华,俞卫锋,高维强,薛蔚,李敏,刘建军,徐群,李鹤,钟华,邵莉," +
                    "张斌渊,周艳,骆华杰,戈欣,胡冰,郑涛,王争,庄捷,奚慧琴,傅小芳,罗诚祖,顾乐怡," +
                    "董晨,袁蕙芸,孙平,王春鸣,石蔚人,王伟,李瑾,马莉,谭蔚泓,龚兴荣,高一红,张坚,郑青," +
                    "沈璐,閤谦";
            List<DemoData> list = new ArrayList<>();
            List<String> stringList = new ArrayList<>();
            for (String s : data.split(",")) {
                if (!stringList.contains(s)) {
                    DemoData demoData = new DemoData();
                    demoData.setName(s);
                    list.add(demoData);
                    stringList.add(s);
                }
            }
            System.out.println(data.replace(",","','"));
            //EasyExcel.write(fileName, DemoData.class).sheet().doWrite(list);
        }catch (Exception e) {
            e.printStackTrace();
        }
    }
}
